<template>
  <div class>
    <el-tabs :tab-position="tabPosition"  type="border-card">
    <el-tab-pane label="关联企业">
        <el-table :data="tableData1" border style="width: 100%" size="mini">
          <el-table-column  align="center" width="80">
            <template slot="header">
             <el-button class="el-icon-circle-plus" @click.prevent="addRow1()"></el-button>
            </template>
            <template slot-scope="scope">
              <el-button size="mini" type="danger" class="el-icon-remove"
              @click="handle1Delete(scope.$index, scope.row)"></el-button>
          </template>
          </el-table-column>
          <el-table-column
            type="index"
            width="50" label="NO.">
          </el-table-column>
          
          <el-table-column label="企业名称" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.name"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="所属行业" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.industry"></el-input>
            </template>
          </el-table-column>
          
          <el-table-column label="注册地址" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.registerAddress"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="注册资本（万元）" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.registerEdcapital"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="额度（万元）" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.quota"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="关联关系" align="center">
            <template slot-scope="scope">
              <el-select v-model="scope.row.relations" >
                <el-option label="高管关联关系" value="1"></el-option>
                <el-option label="出资关联关系" value="2"></el-option>
                <el-option label="担保关联关系" value="3"></el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column label="备注" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.remark"></el-input>
            </template>
          </el-table-column>
        </el-table>
    </el-tab-pane>
    <el-tab-pane label="上下游企业">
        <el-table :data="tableData2" border style="width: 100%" size="mini">
          <el-table-column  align="center" width="80">
            <template slot="header">
             <el-button class="el-icon-circle-plus" @click.prevent="addRow2()"></el-button>
            </template>
            <template slot-scope="scope">
              <el-button size="mini" type="danger" class="el-icon-remove"
              @click="handle2Delete(scope.$index, scope.row)"></el-button>
          </template>
          </el-table-column>
          <el-table-column
            type="index"
            width="50" label="NO.">
          </el-table-column>
          
          <el-table-column label="企业名称" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.name"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="所属行业" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.industry"></el-input>
            </template>
          </el-table-column>
          
          <el-table-column label="法人代表" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.legalRep"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="合作关系" align="center">
            <template slot-scope="scope">
              <el-select v-model="scope.row.partnerShip" >
                <el-option label="上游供应商" value="1"></el-option>
                <el-option label="下游客户" value="2"></el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column label="年销售/采购额(万元)" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.salesSum"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="占比%" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.rate"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="联系人" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.linkman"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="电话" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.linkTel"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="地址" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.address"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="备注" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.remark"></el-input>
            </template>
          </el-table-column>
        </el-table>
    </el-tab-pane>
    <el-tab-pane label="竞争对手">
        <el-table :data="tableData3" border style="width: 100%" size="mini">
          <el-table-column  align="center" width="80">
            <template slot="header">
             <el-button class="el-icon-circle-plus" @click.prevent="addRow3()"></el-button>
            </template>
            <template slot-scope="scope">
              <el-button size="mini" type="danger" class="el-icon-remove"
              @click="handle3Delete(scope.$index, scope.row)"></el-button>
          </template>
          </el-table-column>
          <el-table-column
            type="index"
            width="50" label="NO.">
          </el-table-column>
          
          <el-table-column label="企业名称" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.name"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="所在区域" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.area"></el-input>
            </template>
          </el-table-column>
          
          <el-table-column label="行业地位" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.industryStatus"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="市场交集" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.marketCommunication"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="竞争关系" align="center">
            <template slot-scope="scope">
              <el-select v-model="scope.row.competeRelations" >
                <el-option label="竞争关系01" value="1"></el-option>
                <el-option label="竞争关系02" value="2"></el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column label="威胁程度" align="center">
            <template slot-scope="scope">
              <el-select v-model="scope.row.threat" >
                <el-option label="低" value="1"></el-option>
                <el-option label="中" value="2"></el-option>
                <el-option label="高" value="2"></el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column label="备注" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.remark"></el-input>
            </template>
          </el-table-column>
        </el-table>
    </el-tab-pane>
  </el-tabs>
  </div>
</template>

<script>
export default {
  components: {
  },
  data() {
    return {
        tabPosition:'right',
        tableData1: [],
        tableData2: [],
        tableData3: [],
    };
  },
  computed: {},
  mounted() {},
  methods: {
      //获取关联企业信息
      getglqy(){
          return this.tableData1;
      },
      //获取上下游企业信息
      getsxyqy(){
          return this.tableData2;
      },
      //获取竞争对手信息
      getjzds(){
          return this.tableData3;
      },
    // 增加行
    addRow1() {
      var list = {
          relType:'1',
       }
      this.tableData1.unshift(list)
    },
    addRow2() {
       var list = {
           relType:'2',
       }
      this.tableData2.unshift(list)
    },
    addRow3() {
       var list = {
           relType:'3',
       }
      this.tableData3.unshift(list)
    },
    handle1Delete(index, row) {
        this.tableData1.splice(index, 1);
    },
    handle2Delete(index, row) {
    this.tableData2.splice(index, 1);
    },
    handle3Delete(index, row) {
    this.tableData3.splice(index, 1);
    }
  },
  created() {}
};
</script>
<style lang='scss' scoped>
</style>